/**
 * 评论接口模块
 */
import request from '@/utils/request'

/**
 * 获取评论内容
 * @param {*} params
 * @returns
 */
export const getComments = (params) => {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params
  })
}
/**
 * 新增评论
 * @param {*} data
 * @returns
 */
export const addComment = (data) => {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data
  })
}
/**
 * 对评论或评论回复点赞
 * @param {*} traget
 * @returns
 */
export const addCommentLike = (target) => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target
    }
  })
}
/**
 * 取消评论或评论回复点赞
 * @param {*} traget
 * @returns
 */
export const deleteCommentLike = (target) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`
  })
}
